package com.sci.feign.impl;

import com.sci.entity.Business;
import com.sci.entity.Food;
import com.sci.feign.BusinessServiceClient;
import org.springframework.stereotype.Component;

@Component
public class BusinessServiceClientFallback implements BusinessServiceClient {
    @Override
    public Business getBusinessById(String businessId) {
        Business degradedBusiness = new Business();
        degradedBusiness.setBusinessId("DEFAULT_BUSINESS_ID");
        degradedBusiness.setBusinessName("商家信息暂不可用");
        degradedBusiness.setAddress("地址信息不可用");
        degradedBusiness.setType(0);
        return degradedBusiness;
    }

    @Override
    public Food getFoodById(int foodId) {
        Food degradedFood = new Food();
        degradedFood.setFoodName("商品信息获取失败");
        degradedFood.setPrice(0.0);
        return degradedFood;
    }
}